function uploadDIY(url,filePaths, successUp, failUp, i, length, images_url, cb) {
   console.log(images_url)
  if (filePaths.length == 0) {
    typeof cb == "function" && cb(images_url)
    return;
  }
  my.uploadFile({
    url: url,
    filePath: filePaths[i],
    fileName: 'upload_file',
    fileType:"image",
    success: (data) => {
      console.log(data)
      var temp = i + 1;
      my.showToast({
        content: '第' + temp + '张上传成功',
        type: 'success',
        duration: 700
      })
      successUp++;
      images_url.push(data.data)
    },
    fail: (res) => {
      failUp++;
    },
    complete: () => {
      i++;
      if (i == length) {
        console.log('总共' + successUp + '张上传成功,' + failUp + '张上传失败！');
        typeof cb == "function" && cb(images_url)
      }
      else {  //递归调用uploadDIY函数
        uploadDIY(url,filePaths, successUp, failUp, i, length, images_url, cb);
      }
    },
  });
}

module.exports = {
    upload: uploadDIY
};